package com.sxbbc.common.core.enums;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 首页类型枚举类
 *
 * @author leehao
 * @date 2019-05-25 16:07
 */
public enum ModelTypeEnums {
    NORMAL(1,"普通位置,所有元素一致"),
    SPECIAL(2,"特殊位置,元素各自排列");

    private Integer id;
    private String name;

    ModelTypeEnums(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static List<ModelTypeEnums> queryList(){
        List<ModelTypeEnums> list=new ArrayList<ModelTypeEnums>();
        for(ModelTypeEnums o:ModelTypeEnums.values()){
            list.add(o);
        }
        return list;
    }

    public static String getName(Integer id){
        String str="";
        for(ModelTypeEnums o:ModelTypeEnums.values()){
            if(CalcuUtils.getInstance().isEquals(id, o.getId())){
                str= o.getName();
                break;
            }
        }
        return str;
    }
}
